import axios from 'axios'

export function login(data) {
  return axios.post('/user/login', data)
}

export function register(data) {
  return axios.post('/user/register', data)
}

export function getUserInfo() {
  return axios.get('/user/info')
}

export function updateUserInfo(data) {
  return axios.put('/user/info', data)
}

export function getUserAddressList() {
  return axios.get('/user/address')
}

export function addAddress(data) {
  return axios.post('/user/address', data)
}

export function updateAddress(id, data) {
  return axios.put(`/user/address/${id}`, data)
}

export function deleteAddress(id) {
  return axios.delete(`/user/address/${id}`)
}

export function getUserOrders() {
  return axios.get('/user/orders')
}

